//sort
var arr = ['Google', 'apple', 'Microsoft'];
arr.sort(function (x,y){
    x1=x.toLowerCase();
    y1=y.toLowerCase();
    if(x<y){return 1;}
    if(x>y){return -1;}
    return 0;
})
console.log(arr);

//every
var arr1 = ['Google', 'apple', 'Microsoft'];
var y=arr1.every(function (x){
        return x.length>0;
})
var y1=arr1.every(function (x){
    return x.toLowerCase() === x;
})
console.log(y);
console.log(y1);

//find
var arr = ['Apple', 'pear', 'orange'];arr.find(function(pp){
    return pp.substring(0,1)==='p'
})
console.log(arr.find(function(pp){
    return pp.substring(0,1)==='p'
}));

//foreach
var arr = ['Apple', 'pear', 'orange'];
arr.forEach(console.log); // 依次打印每个元素
//"Apple"
//"pear"
//"orange"